-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
O3-4357: Add Allergy Recording to Patient Visit Scenario #54
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for subbiting the draft pr @Bawanthathilan! 🎉 I’ve added a few comments. Take a peek and let me know if you have any questions.
src/test/java/org/openmrs/performance/scenarios/VisitPatientScenario.java
Outdated
Show resolved
Hide resolved
src/test/java/org/openmrs/performance/registries/DoctorRegistry.java
Outdated
Show resolved
Hide resolved
src/test/java/org/openmrs/performance/registries/DoctorRegistry.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Bawanthathilan , getting close! See my updated thoughts/questions.
|
||
|
||
return http("Save Allergies of Patient") | ||
.get("/openmrs/ws/rest/v1/patient/"+ patientUuid +"/allergy") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.get("/openmrs/ws/rest/v1/patient/"+ patientUuid +"/allergy") | |
.post("/openmrs/ws/rest/v1/patient/"+ patientUuid +"/allergy") |
payload.put("reactions", reactions); | ||
|
||
|
||
return http("Save Allergies of Patient") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return http("Save Allergies of Patient") | |
return http("Save an Allergy") |
|
||
public HttpRequestActionBuilder getAllergies(String patientUuid) { | ||
return http("Get Allergies of Patient") | ||
.get("/openmrs/ws/fhir2/R4/AllergyIntolerance?patient=" + patientUuid + "&_summary=data"); | ||
} | ||
|
||
public HttpRequestActionBuilder GetDrugAllergens(String drugAllergenUuid) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public HttpRequestActionBuilder GetDrugAllergens(String drugAllergenUuid) { | |
public HttpRequestActionBuilder getDrugAllergens(String drugAllergenUuid) { |
Method names should be named in lower camel case (starts with a lowercase).
public HttpRequestActionBuilder GetEnvironmentAllergens(String environmentalAllergenUuid) { | ||
return http("Get Environment Allergens") | ||
.get("/openmrs/ws/rest/v1/concept/" + environmentalAllergenUuid + "?v=full"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's the same API call, how about we make it a single call and use the passed parameter?
ex:
getAllergens(environmentalAllergenUuid),
getAllergens(drugAllergenUuid),
...
Map<String, Object> payload = new HashMap<>(); | ||
|
||
Map<String,String> codedAllergen = new HashMap<>(); | ||
codedAllergen.put("uuid", "71617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make the UUID a constant and move it to the Constants.java file. That way it’ll be super clear what this UUID is for and we can easily reuse it in other parts of the code.
@@ -29,6 +29,8 @@ public ScenarioBuilder getScenarioBuilder() { | |||
.exec(registry.openOrdersTab("#{patient_uuid}")) | |||
.exec(registry.openLabResultsTab("#{patient_uuid}")) | |||
.exec(registry.openAllergiesTab("#{patient_uuid}")) | |||
.exec(registry.OpenAllergiesForm()) | |||
.exec(registry.addAllergies("#{patient_uuid}")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.exec(registry.addAllergies("#{patient_uuid}")) | |
.exec(registry.recordAllergy("#{patient_uuid}")) |
String drugAllergenUuid = "162555AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; | ||
String environmentalAllergenUuid = "162552AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; | ||
String foodAllergenUuid = "162554AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; | ||
String allergyReactionUuid = "162553AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s add this to the constants.java file too.
@@ -148,11 +152,78 @@ public HttpRequestActionBuilder getDrugOrders(String patientUuid) { | |||
"&status=any&orderType=" + DRUG_ORDER + | |||
"&v=" + customRepresentation); | |||
} | |||
|
|||
public HttpRequestActionBuilder searchPatient(String searchQuery) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused method
.get("/openmrs/ws/rest/v1/concept/" + allergyReactionUuid + "?v=full"); | ||
} | ||
|
||
public HttpRequestActionBuilder saveAllergies(String patientUuid) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public HttpRequestActionBuilder saveAllergies(String patientUuid) { | |
public HttpRequestActionBuilder saveAllergy(String patientUuid) { |
711dd69
to
6f98645
Compare
This pull request introduces the following changes to enhance the patient visit scenario by incorporating allergy recording functionality:
|
payload.put("reactions", reactions); | ||
|
||
try{ | ||
return http("Save an Allergies") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return http("Save an Allergies") | |
return http("Save an Allergy") |
|
||
public HttpRequestActionBuilder getAllergies(String patientUuid) { | ||
public HttpRequestActionBuilder GetAllergies(String patientUuid) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public HttpRequestActionBuilder GetAllergies(String patientUuid) { | |
public HttpRequestActionBuilder getAllergies(String patientUuid) { |
Method names should be named in lower camel case (starts with a lowercase).
@@ -147,11 +154,54 @@ public HttpRequestActionBuilder getDrugOrders(String patientUuid) { | |||
"&careSetting=" + CARE_SETTING_UUID + | |||
"&status=any&orderType=" + DRUG_ORDER + | |||
"&v=" + customRepresentation); | |||
} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
} |
|
||
// Allergies | ||
public static final String DRUG_ALLERGEN_UUID = "162555AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; | ||
public static final String ENVIRONMENTAL_ALLERGEN_UUID = "162552AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public static final String ENVIRONMENTAL_ALLERGEN_UUID = "162552AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; | |
public static final String ENVIRONMENTAL_ALLERGEN_UUID = "162552AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; |
@@ -29,6 +29,8 @@ public ScenarioBuilder getScenarioBuilder() { | |||
.exec(registry.openOrdersTab("#{patient_uuid}")) | |||
.exec(registry.openLabResultsTab("#{patient_uuid}")) | |||
.exec(registry.openAllergiesTab("#{patient_uuid}")) | |||
.exec(registry.OpenAllergiesForm()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.exec(registry.OpenAllergiesForm()) | |
.exec(registry.openAllergiesForm()) |
try{ | ||
return http("Save an Allergy") | ||
.post("/openmrs/ws/rest/v1/patient/"+ patientUuid +"/allergy") | ||
.body(StringBody(new ObjectMapper().writeValueAsString(payload))); | ||
}catch (JsonProcessingException e) { | ||
throw new RuntimeException(e); | ||
} | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try{ | |
return http("Save an Allergy") | |
.post("/openmrs/ws/rest/v1/patient/"+ patientUuid +"/allergy") | |
.body(StringBody(new ObjectMapper().writeValueAsString(payload))); | |
}catch (JsonProcessingException e) { | |
throw new RuntimeException(e); | |
} | |
try{ | |
return http("Save an Allergy") | |
.post("/openmrs/ws/rest/v1/patient/"+ patientUuid +"/allergy") | |
.body(StringBody(new ObjectMapper().writeValueAsString(payload))); | |
} catch (JsonProcessingException e) { | |
throw new RuntimeException(e); | |
} |
public static final String FOOD_ALLERGEN_UUID = "162554AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; | ||
public static final String ALLERGY_REACTION_UUID = "162553AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; | ||
public static final String CODED_ALLERGEN_UUID = "71617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; | ||
public static final String SEVERITY_UUID = "1498AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an extra space here.
@@ -152,6 +159,49 @@ public HttpRequestActionBuilder getDrugOrders(String patientUuid) { | |||
public HttpRequestActionBuilder getAllergies(String patientUuid) { | |||
return http("Get Allergies of Patient") | |||
.get("/openmrs/ws/fhir2/R4/AllergyIntolerance?patient=" + patientUuid + "&_summary=data"); | |||
} | |||
|
|||
public HttpRequestActionBuilder getAllergen(String allergenType, String allergenUuid) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public HttpRequestActionBuilder getAllergen(String allergenType, String allergenUuid) { | |
public HttpRequestActionBuilder getAllergens(String allergenType, String allergenUuid) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thank you so much for getting this done, @Bawanthathilan! 🎉
This pull request introduces the following changes to enhance the patient visit scenario by incorporating allergy recording functionality:
The patient visit scenario is updated to include allergy recording functionality.
Allergy recording action is implemented in the DoctorRegistry.java file.
Relevant HTTP requests for allergy recording are added to the DoctorHttpService.java file.
Ticket URL:
O3-4357: Enhance Patient Visit with Allergy Recording